import axios from '@/core/utils/AxiosRequest'

/**
 * 广告-位置-接口
 */
const prefix = '/api/advert/position'
export default {
  /**
   * 获取分页表
   * @param {*} payload
   * @returns
   */
  getListByPage(payload) {
    console.info(JSON.stringify(payload))
    return axios.get(prefix + '/getListDataByPage', { parmas: payload })
  },

  /**
   * 获取按ID获取表单信息
   * @param {*} id
   * @returns
   */
  getFormModelById(id) {
    return axios.get(prefix + '/getFormDataById?id='+id)
  },

  /**
   * 保存数据
   * @param {*} payload
   * @returns
   */
  saveData(payload) {
    return axios.post(prefix + '/saveData', payload)
  },

  /**
   *  按单个ID删除数据
   * @param {*} id
   * @returns
   */
  deleteDataById(id) {
    return axios.get(prefix + '/deleteDataById?id='+id)
  },

  /**
   * 多个key删除数据
   * @param {key[]} payload
   * @returns
   */
  deleteData(payload) {
    return axios.get(prefix + '/deleteData', {params: payload})
  },

  /**
   * 审核
   * @param {
   *  keys: [],
   *  action: 'reject/approve',
   *  reason: '原因'
   * } payload
   * @returns
   */
  auditData(payload) {
    return axios.get(prefix + '/auditData', { params: payload })
  },

  /**
   * 确认
   * @param {keys: []} payload
   * @returns
   */
  confirmData(payload) {
    return axios.get(prefix + '/confirmData', { params: payload })
  }
}